home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Main.bin / DataOutput.java < prev    next >
Text File  |  1998-09-22  |  5KB  |  160 lines

  1. /*
  2.  * @(#)DataOutput.java    1.7 98/07/01
  3.  *
  4.  * Copyright 1995-1998 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  * 
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14.  
  15. package java.io;
  16.  
  17. /**
  18.  * The data output interface is implemented by streams that can 
  19.  * write primitive Java data types to an output stream in a 
  20.  * machine-independent manner. 
  21.  *
  22.  * @author  Frank Yellin
  23.  * @version 1.7, 07/01/98
  24.  * @see     java.io.DataInput  
  25.  * @see     java.io.DataOutputStream
  26.  * @since   JDK1.0
  27.  */
  28. public
  29. interface DataOutput {
  30.     /**
  31.      * Writes the specified byte to this data output stream. 
  32.      *
  33.      * @param      b   the byte to be written.
  34.      * @exception  IOException  if an I/O error occurs.
  35.      * @since      JDK1.0
  36.      */
  37.     void write(int b) throws IOException;
  38.  
  39.     /**
  40.      * Writes <code>b.length</code> bytes from the specified byte array 
  41.      * to this output stream. 
  42.      *
  43.      * @param      b   the data.
  44.      * @exception  IOException  if an I/O error occurs.
  45.      * @since      JDK1.0
  46.      */
  47.     void write(byte b[]) throws IOException;
  48.  
  49.     /**
  50.      * Writes <code>len</code> bytes from the specified byte array 
  51.      * starting at offset <code>off</code> to this output stream. 
  52.      *
  53.      * @param      b     the data.
  54.      * @param      off   the start offset in the data.
  55.      * @param      len   the number of bytes to write.
  56.      * @exception  IOException  if an I/O error occurs.
  57.      * @since      JDK1.0
  58.      */
  59.     void write(byte b[], int off, int len) throws IOException;
  60.  
  61.     /**
  62.      * Writes a <code>boolean</code> value to this output stream. 
  63.      *
  64.      * @param      v   the boolean to be written.
  65.      * @exception  IOException  if an I/O error occurs.
  66.      * @since      JDK1.0
  67.      */
  68.     void writeBoolean(boolean v) throws IOException;
  69.  
  70.     /**
  71.      * Writes an 8-bit value to this output stream. 
  72.      *
  73.      * @param      v   the byte value to be written.
  74.      * @exception  IOException  if an I/O error occurs.
  75.      * @since      JDK1.0
  76.      */
  77.     void writeByte(int v) throws IOException;
  78.  
  79.     /**
  80.      * Writes a 16-bit value to this output stream. 
  81.      *
  82.      * @param      v   the <code>short</code> value to be written.
  83.      * @exception  IOException  if an I/O error occurs.
  84.      * @since      JDK1.0
  85.      */
  86.     void writeShort(int v) throws IOException;
  87.  
  88.     /**
  89.      * Writes a <code>char</code> value to this output stream. 
  90.      *
  91.      * @param      v   the <code>char</code> value to be written.
  92.      * @exception  IOException  if an I/O error occurs.
  93.      * @since      JDK1.0
  94.      */
  95.     void writeChar(int v) throws IOException;
  96.  
  97.     /**
  98.      * Writes an <code>int</code> value to this output stream. 
  99.      *
  100.      * @param      v   the <code>int</code> value to be written.
  101.      * @exception  IOException  if an I/O error occurs.
  102.      * @since      JDK1.0
  103.      */
  104.     void writeInt(int v) throws IOException;
  105.  
  106.     /**
  107.      * Writes a <code>long</code> value to this output stream. 
  108.      *
  109.      * @param      v   the <code>long</code> value to be written.
  110.      * @exception  IOException  if an I/O error occurs.
  111.      * @since      JDK1.0
  112.      */
  113.     void writeLong(long v) throws IOException;
  114.  
  115.     /**
  116.      * Writes a <code>float</code> value to this output stream. 
  117.      *
  118.      * @param      v   the <code>float</code> value to be written.
  119.      * @exception  IOException  if an I/O error occurs.
  120.      * @since      JDK1.0
  121.      */
  122.     void writeFloat(float v) throws IOException;
  123.  
  124.     /**
  125.      * Writes a <code>double</code> value to this output stream. 
  126.      *
  127.      * @param      v   the <code>double</code> value to be written.
  128.      * @exception  IOException  if an I/O error occurs.
  129.      * @since      JDK1.0
  130.      */
  131.     void writeDouble(double v) throws IOException;
  132.  
  133.     /**
  134.      * Writes a string to this output stream. 
  135.      *
  136.      * @param      s   the string of bytes to be written.
  137.      * @exception  IOException  if an I/O error occurs.
  138.      * @since      JDK1.0
  139.      */
  140.     void writeBytes(String s) throws IOException;
  141.  
  142.     /**
  143.      * Writes a string to this output stream. 
  144.      *
  145.      * @param      s   the string value to be written.
  146.      * @exception  IOException  if an I/O error occurs.
  147.      * @since      JDK1.0
  148.      */
  149.     void writeChars(String s) throws IOException;
  150.  
  151.     /**
  152.      * Writes a Unicode string by encoding it using modified UTF-8 format.
  153.      *
  154.      * @param      str   the string value to be written.
  155.      * @exception  IOException  if an I/O error occurs.
  156.      * @since   JDK1.0
  157.      */
  158.     void writeUTF(String str) throws IOException;
  159. }
  160.